package br.com.fiap.mercadinho.common;

/**
 * Representa os tipos possiveis de usuarios no sistema.
 * 
 * @author Jeferson Lamas
 * @since 22/05/2013
 */
public enum UserType {

	// Operator User
	OPERATOR("O"),
	// Manager User
	MANAGER("M");

	private String value;

	UserType(String userType) {
		this.value = userType;
	}

	public String getValue() {

		return value;
	}

	public static UserType fromString(String text) {
		if (text != null) {
			for (UserType userType : UserType.values()) {
				if (text.equalsIgnoreCase(userType.value)) {
					return userType;
				}
			}
		}
		return null;
	}

}
